import VueRouter from "vue-router";
import Vue from "vue";

Vue.use(VueRouter);

import HomePage from "@/components/HomePage.vue"
import Login from "@/components/Login.vue"
import Register from "@/components/Register.vue"
import Detail from "@/components/Detail.vue"
import Cart from "@/components/Cart.vue"
import Count from "@/components/Count.vue"
import Developing from "@/components/Developing.vue"
import OrderCenter from "@/components/OrderCenter.vue"
import OrderDetail from "@/components/OrderDetail.vue"
import UserDetail from "@/components/UserDetail.vue"

const router = new VueRouter({
    routes: [{
            path: "/",
            component: HomePage
        },
        {
            path: "/login",
            component: Login
        },
        {
            path: "/register",
            component: Register
        },
        {
            path: "/detail",
            component: Detail
        },
        {
            path: "/cart",
            component: Cart
        },
        {
            path: "/count",
            component: Count
        },
        {
            path: "/orderCenter",
            component: OrderCenter
        },
        {
            path: "/orderDetail",
            component: OrderDetail
        },
        {
            path: "/developing",
            component: Developing
        },
        {
            path: "/userDetail",
            component: UserDetail
        },

    ],
    scrollBehavior() {
        window.scrollTo(0, 0);
    }

});

export default router;